export  function dbboun(fn,delay){
    let timer = null
        return function(e){
            console.log(e);
             clearTimeout(timer)
            timer=setTimeout(()=>{
                fn.call(this)
            },delay)
        }
}



// export function debounce(fn, delay) {
//     let timer = null;
//     return function (args) {
//         console.log(args);
//         let that = this;
//         if (timer) clearTimeout(timer)
//         timer = setTimeout(() => {
//             fn.call(that,...args)
//         },delay)
//     }
// }